package hw;
//this class defines the properties of a given shipment; source city, destination etc. 
public class Shipment {

	private String cityFrom;
	private String cityTo;
	private double weight;
	private int numberOfItems;
	
	public Shipment(String cityFrom,String cityTo,int numberOfItems,double weight) {
	 this.setCityFrom(cityFrom);
	 this.setCityTo(cityTo);
	 this.setNumberOfItems(numberOfItems);
	 this.setWeight(weight);
	}
//check whether weight < 0 
	public void setWeight(double weight) {
		if(weight <= 0) {
			System.out.println("Weight cannot be <= 0");// if less than 0 notify the user
			return;
		} else {
			this.weight = weight; }
	}
	
	public double getWeight() {
		return this.weight;
	}
	// number of items should not be less than 1 
	public void setNumberOfItems(int numberOfItems) {
		if(numberOfItems <= 0) {
			System.out.println("Number of items cannot be <= 0");//if less than 0 notify the user
			return;
		} else {
			this.numberOfItems = numberOfItems; }
	}
	
	public double getNumberOfItems() {
		return this.numberOfItems;
	}
	
	
	
public void setCityFrom(String cityFrom) {
		this.cityFrom = cityFrom;
	}


   public String getCityFrom() {
	   return this.cityFrom;
   }

public String getCityTo() {
	return cityTo;
}

public void setCityTo(String cityTo) {
	this.cityTo = cityTo;
}
   }
